# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=py3-mysqlclient
pkgver=2.1.1
pkgrel=0
pkgdesc="MySQL database connector for Python (with py3 support)"
url="https://mysqlclient.readthedocs.io/"
arch="all"
license="GPL-2.0-or-later"
makedepends="python3-dev py3-setuptools mariadb-dev"
source="mysqlclient-python-$pkgver.tar.gz::https://github.com/PyMySQL/mysqlclient-python/archive/v$pkgver.tar.gz"
builddir="$srcdir/mysqlclient-$pkgver"

replaces="py-mysqlclient" # Backwards compatibility
provides="py-mysqlclient=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	CFLAGS="$CFLAGS -I/usr/include/mysql" python3 setup.py build
}

check() {
	python3 setup.py test
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="
81b82e52e4e5911371c24691ffac7575096a90cfdc6389379c12bf8a85b6260e5af9a0ac2996e3a024a20202e6fceb6ba4f5c12527d8055a4af18b41dd958cd6  mysqlclient-python-2.1.1.tar.gz
"
